{include file="public/layout" /}
<body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
{include file="system/left" /}
<div class="page min-hg-c-10" style="min-width:auto;margin-left:100px;display: flex;">
    <div class="flexigrid" style="width: 380px;">
        <div class="mobile-flex">
            <div class="mobile-iframe">
                <div class="mobile-iframe-wrap">
                    <iframe src="{$Request.domain}__ROOT_DIR__/h5/" frameborder="0" width="100%"></iframe>
                </div>
            </div>
        </div>
    </div>
    <div class="flexigrid" style="flex: 1;">
        <div style="padding: 20px;border: 1px solid #eee;border-radius: 8px;">
            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0" style="width: 100%">
                        <thead>
                            <tr>
                                <th abbr="" axis="col3">
                                    <div class="tl text-l10">图片广告</div>
                                </th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <div class="tab-pane">
                <div class="mt15">
                    <form id="post_ad_content_3" method="post" data-url="{:url('Decoration/save_ad',['position_id'=>3])}">
                        <div class="adv-row-con sort-list" data-type="3" id="ad_content_3">
                            {foreach name="$ad_list_3" item="vo" key="k" }
                            <div class="adv-col-5 sort-list-col" data-key="{$k+1}" id='ad_content_div_3_{$k+1}'>
                                <div class="adv-etm">
                                    <div class="adv-etm-l">
                                        <input type="hidden" id="input_content_images_3_{$k+1}" name="data[{$k+1}][content_images]" value="{$vo.content_images}">
                                        <img id="img_content_images_3_{$k+1}" src="{$vo.content_images}">
                                        <span class="s-tihuan"><i class="iconfont e-bianji2 f-24" onclick="GetUploadify(1,'','allimg','ci_call_back_3_{$k+1}');"></i></span>
                                    </div>
                                    <div class="adv-etm-r">
                                        <!-- <div class="title">
                                            <input name="data[{$k+1}][content_title]" value="{$vo.content_title}" placeholder="请输入标题" class="input-txt" type="text" onchange="changeAdTitle(this,3);">
                                        </div> -->
                                        <div class="set-bt">
                                            <input type="hidden" name="data[{$k+1}][link_id]" value="{$vo.link_id}" id='linkIDHidden_3_{$k+1}'>
                                            <input type="hidden" name="data[{$k+1}][host_id]" value="{$vo.host_id}" id='hostIDHidden_3_{$k+1}'>
                                            <span id="ad_link_title_3_{$k+1}" title="{$vo.link_names}">{$vo.link_names}</span>
                                            <a href="javascript:void(0);" data-ad_host_id="{$vo.host_id}" data-ad_link_id="{$vo.link_id}" onclick="adSelectLink(this,3,{$k+1});">设置链接</a>
                                        </div>
                                    </div>
                                    <span class="delect" data-url="{:url('Decoration/del_ad',['content_id'=>$vo.content_id])}" data-id="3_{$k+1}" onclick="del_ad_0429(this);"></span>
                                    <span class="drag-handle"><i class="iconfont e-gengduo"></i></span>
                                </div>
                                <input type="hidden" name="data[{$k+1}][content_id]" value="{$vo.content_id}">
                            </div>
                            <script type="text/javascript">
                               function ci_call_back_3_{$k+1}(fileurl_tmp){
                                    call_back('3_{$k+1}','content_images',fileurl_tmp,3);
                                }
                            </script>
                            {/foreach}
                            <div class="adv-col-5" onclick="addAdContent(3);">
                                <div class="adv-etm">
                                    <div class="adv-add">
                                        <div class="adv-box">
                                            <div class="y-line"></div>
                                            <div class="x-line"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                    
                </div>
            </div>
            
            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0" style="width: 100%">
                        <thead>
                            <tr>
                                <th abbr="" axis="col3">
                                    <div class="tl text-l10" >首页金刚位</div>
                                </th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <div class="tab-pane">
                <div class="mt15">
                    <form id="post_ad_content_2" method="post" data-url="{:url('Decoration/save_ad',['position_id'=>2])}">
                        <div class="adv-row-con sort-list" data-type="2" id="ad_content_2">
                            {foreach name="$ad_list_2" item="vo" key="k" }
                            <div class="adv-col-5 sort-list-col" data-key="{$k+1}" id='ad_content_div_2_{$k+1}'>
                                <div class="adv-etm">
                                    <div class="adv-etm-l">
                                        <input type="hidden" id="input_content_images_2_{$k+1}" name="data[{$k+1}][content_images]" value="{$vo.content_images}">
                                        <img id="img_content_images_2_{$k+1}" src="{$vo.content_images}">
                                        <span class="s-tihuan"><i class="iconfont e-bianji2 f-24" onclick="GetUploadify(1,'','allimg','ci_call_back_2_{$k+1}');"></i></span>
                                    </div>
                                    <div class="adv-etm-r">
                                        <div class="title">
                                            <input name="data[{$k+1}][content_title]" value="{$vo.content_title}" placeholder="请输入标题" class="input-txt" type="text" onchange="changeAdTitle(this,2);">
                                        </div>
                                        <div class="set-bt">
                                            <input type="hidden" name="data[{$k+1}][link_id]" value="{$vo.link_id}" id='linkIDHidden_2_{$k+1}'>
                                            <input type="hidden" name="data[{$k+1}][host_id]" value="{$vo.host_id}" id='hostIDHidden_2_{$k+1}'>
                                            <span id="ad_link_title_2_{$k+1}" title="{$vo.link_names}">{$vo.link_names}</span>
                                            <a href="javascript:void(0);" data-ad_host_id="{$vo.host_id}" data-ad_link_id="{$vo.link_id}" onclick="adSelectLink(this,2,{$k+1});">设置链接</a>
                                        </div>
                                    </div>
                                    <span class="delect" data-url="{:url('Decoration/del_ad',['content_id'=>$vo.content_id])}" data-id="2_{$k+1}" onclick="del_ad_0429(this);"></span>
                                    <span class="drag-handle"><i class="iconfont e-gengduo"></i></span>
                                </div>
                                <input type="hidden" name="data[{$k+1}][content_id]" value="{$vo.content_id}">
                            </div>
                            <script type="text/javascript">
                                function ci_call_back_2_{$k+1}(fileurl_tmp){
                                    call_back('2_{$k+1}','content_images',fileurl_tmp,2);
                                }
                            </script>
                            {/foreach}
                            <div class="adv-col-5" onclick="addAdContent(2);">
                                <div class="adv-etm">
                                    <div class="adv-add">
                                        <div class="adv-box">
                                            <div class="y-line"></div>
                                            <div class="x-line"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            
            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0" style="width: 100%">
                        <thead>
                            <tr>
                                <th abbr="" axis="col3">
                                    <div class="tl text-l10" > 底部菜单 </div>
                                </th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <div class="tab-pane">
            
                <div class="mt15">
                    <form id="bottom_post" method="post" data-url="{:url('Decoration/save_bottom')}">
                        <div class="b-nav-row-con sort-list" data-type="bottom">
                            {foreach name="$bottom_list" item="vo" key="k" }
                            {if condition="$k <= 4"}
                            <div class="b-nav-col-5 nav-div-0429" id="bottom_div_{$k+1}" data-key="{$k+1}">
                                <div class="b-nav-etm">
                                    <div class="nav-litpic-box">
                                        <div class="box-l">图标</div>
                                        <div class="box-r">
                                            <div class="nav-litpic">
                                                <div class="litpic">
                                                    <input type="hidden" id="input_default_pic_{$k+1}" name="data[{$k+1}][default_pic]" value="{$vo.default_pic}">
                                                    <img id="img_default_pic_{$k+1}" src="{$vo.default_pic}">
                                                    <span class="s-tihuan"><i class="iconfont e-bianji2 f-24" onclick="GetUploadify(1,'','allimg','default_pic_call_back_{$k+1}');"></i></span>
                                                </div>
                                                <div class="name">未选中</div>
                                            </div>
                                            <div class="nav-litpic">
                                                <div class="litpic">
                                                    <input type="hidden" id="input_selected_pic_{$k+1}" name="data[{$k+1}][selected_pic]" value="{$vo.selected_pic}">
                                                    <img id="img_selected_pic_{$k+1}" src="{$vo.selected_pic}">
                                                    <span class="s-tihuan"><i class="iconfont e-bianji2 f-24" onclick="GetUploadify(1,'','allimg','selected_pic_call_back_{$k+1}')"></i></span>
                                                </div>
                                                <div class="name">已选中</div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="title">
                                        <div class="box-l">标题</div>
                                        <div class="box-r">
                                            <input type="text" value="{$vo.nav_title}" placeholder="请输入标题" onchange='changeBottomTitle(this);' class="input-txt" name="data[{$k+1}][nav_title]">
                                        </div>
                                    </div>
                                    <div class="set-bt">
                                        <div class="box-l">链接</div>
                                        <div class="box-r">
                                            <input type="hidden" value="{$vo.host_id}" name="data[{$k+1}][host_id]" id="hostIDHidden_{$k+1}">
                                            <input type="hidden" value="{$vo.link_id}" name="data[{$k+1}][link_id]" id="linkIDHidden_{$k+1}">
                                            <span id="linkNames_{$k+1}">{$vo.link_names}</span>
                                            <a href="javascript:void(0);" onclick="bottomSelectLink(this, {$k+1});">设置链接</a>
                                        </div>
                                    </div>
                                </div>
                                <span class="delect" data-url="{:url('Decoration/del_bottom',['nav_id'=>$vo.nav_id])}" data-id="{$k+1}" onclick="del_bottom_0429(this);"></span>
                                <span class="drag-handle"><i class="iconfont e-gengduo"></i></span>
                                <input type="hidden" name="data[{$k+1}][nav_id]" value="{$vo.nav_id}">
                            </div>
                            <script type="text/javascript">
                                function default_pic_call_back_{$k+1}(fileurl_tmp){
                                    call_back({$k+1},'default_pic',fileurl_tmp);
                                }
                                function selected_pic_call_back_{$k+1}(fileurl_tmp){
                                    call_back({$k+1},'selected_pic',fileurl_tmp);
                                }
                            </script>
                            {/if}
                            {/foreach}
            
                            <!--填充内容-->
            
                            <div class="b-nav-col-5" id="addClick" onclick="showCustomNav();">
                                <div class="b-nav-etm" style="padding: 20px;">
                                    <div class="b-nav-add">
                                        <div class="b-nav-box">
                                            <div class="y-line"></div>
                                            <div class="x-line"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
            
                </div>
            </div>
        </div>
        
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {

        // 初始化Sortable插件，但禁用自动拖动开始  
        $(".sort-list").sortable({
            handle: '.drag-handle', // 指定拖动句柄为.drag-handle类的元素  
            start: function(event, ui) {
                // 在这里可以执行拖动开始时的逻辑，例如更新UI或发送请求  
            },
            stop: function(event, ui) {
                var type = $(event.target).data('type');
                if ('bottom' == type){
                    submit_bottom();
                } else {
                    submit_ad(type);
                }
            }
        });
    });
</script>
<script src="__SKIN__/js/decoration.js?v={$version}"></script>

{include file="public/footer" /}